package com.haoqizhe.kernel.activemq.entity;

/**
 * 消费消息参数
 *
 * @author  haoqizhe.li on 2017/6/27.
 */
public class ReceiveParam {
    /**
     * 消息类型，true topic / false  queue
     */
    private boolean pubSubDomain = false;
    /**
     *  消费的消息目的地
     */
    private String destinationName;
    /**
     * 是否支持事务管理，开启事务支持后，sessionAcknowledgeMode 只能选Session.SESSION_TRANSACTED; 0  事务提交确认
     */
    private boolean sessionTransacted;
    /**
     * 消息确认ACK模式 消费者才有用
     * Session.AUTO_ACKNOWLEDGE; 1  自动确认
     * Session.CLIENT_ACKNOWLEDGE; 2  客户端确认
     * Session.DUPS_OK_ACKNOWLEDGE; 3  批量确认
     * Session.SESSION_TRANSACTED; 0  事务提交确认
     *
     */
    private int sessionAcknowledgeMode;
    /**
     * 接收消息超时时间
     */
    private long receiveTimeout;

    public ReceiveParam(){
        this.sessionTransacted = true;
        this.sessionAcknowledgeMode = 0;
        this.pubSubDomain = false;
        this.receiveTimeout = 0L;
    }


    public boolean isPubSubDomain() {
        return pubSubDomain;
    }

    public void setPubSubDomain(boolean pubSubDomain) {
        this.pubSubDomain = pubSubDomain;
    }

    public String getDestinationName() {
        return destinationName;
    }

    public void setDestinationName(String destinationName) {
        this.destinationName = destinationName;
    }

    public boolean isSessionTransacted() {
        return sessionTransacted;
    }

    public void setSessionTransacted(boolean sessionTransacted) {
        this.sessionTransacted = sessionTransacted;
    }

    public int getSessionAcknowledgeMode() {
        return sessionAcknowledgeMode;
    }

    public void setSessionAcknowledgeMode(int sessionAcknowledgeMode) {
        this.sessionAcknowledgeMode = sessionAcknowledgeMode;
    }

    public long getReceiveTimeout() {
        return receiveTimeout;
    }

    public void setReceiveTimeout(long receiveTimeout) {
        this.receiveTimeout = receiveTimeout;
    }
}
